<!DOCTYPE html>
<html lang='en'>

<head>
    <meta charset='UTF-8'>
    <meta http-equiv='X-UA-Compatible' content='IE=edge'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <title>工资想过万，键盘要敲烂</title>
    <style>
 
    </style>
</head>

<body>
 
<script>


let str='我爱我家'
str=str.replace(/我/g,'<span style="color:red">我</span>')
document.body.innerHTML=str
</script>
</body>

</html>